<?php

use Biz\service\Album\AlbumRecommendService;
use Doraemon\service\statSign\Basic as statSign;
use Doraemon\tools\BlockType;

/**
 * 清单广场达人清单
 */
class DaRenAlbumAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    /**
     * @throws \Exception
     */
    public function main()
    {
        $recommend = AlbumRecommendService::darenRecommend();
        $i = 1;
        foreach ($recommend as $key => $row) {
            foreach ($row['album_list'] as $aKey => $info) {
                $recommend[$key]['album_list'][$aKey]['statSign'] = statSign::genStatSign(statSign::MODULE_GOOD_ALBUM_PAGE_ALBUM_LIST, [
                    statSign::EXTEND_KEY_OBJ_ID => $info['album_info']['album_id'],
                    statSign::EXTEND_KEY_OBJ_TYPE => BlockType::TYPE_WIKI_ALBUM,
                    statSign::EXTEND_KEY_POS => 'center',
                    statSign::EXTEND_KEY_INDEX => $i,
                ]);
            }
            $i++;
        }
        $this->setSuccess(['list' => $recommend]);
    }
}